// //  ********************************************************************************
// //  Copyright (C) 2016 Sebastian Kenter. All rights reserved.
// // 
// //  Name    : PhotonServerProject | PhotonServerCommon | RealmListMessage.cs
// //  Created : 2016 - 04 - 18 08:40
// //  Modified: 2016 - 04 - 18 09:38
// //  ********************************************************************************

#pragma warning disable 1591, 0612, 3021

#region Designer generated code

using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;

namespace PhotonServerCommon.Messages
{
    /// <summary>Holder for reflection information generated from RealmListMessage.proto</summary>
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    public static partial class RealmListMessageReflection
    {
        #region Descriptor

        /// <summary>File descriptor for RealmListMessage.proto</summary>
        public static pbr::FileDescriptor Descriptor
        {
            get { return descriptor; }
        }

        private static pbr::FileDescriptor descriptor;

        static RealmListMessageReflection()
        {
            byte[] descriptorData = global::System.Convert.FromBase64String(
                string.Concat(
                    "ChZSZWFsbUxpc3RNZXNzYWdlLnByb3RvEhtQaG90b25TZXJ2ZXJDb21tb24u",
                    "TWVzc2FnZXMiSgoJUmVhbG1MaXN0Ej0KC1JlYWxtU2VydmVyGAEgAygLMigu",
                    "UGhvdG9uU2VydmVyQ29tbW9uLk1lc3NhZ2VzLlJlYWxtU2VydmVyInwKC1Jl",
                    "YWxtU2VydmVyEhEKCVJlYWxtTmFtZRgBIAEoCRIVCg1SZWFsbVNlcnZlcklk",
                    "GAIgASgJEhkKEUN1cnJlbnRQb3B1bGF0aW9uGAMgASgFEhkKEU1heGltdW1Q",
                    "b3B1bGF0aW9uGAQgASgFEg0KBVF1ZXVlGAUgASgFYgZwcm90bzM="));
            descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
                new pbr::FileDescriptor[] {},
                new pbr::GeneratedCodeInfo(null, new pbr::GeneratedCodeInfo[]
                                                 {
                                                     new pbr::GeneratedCodeInfo(
                                                         typeof (global::PhotonServerCommon.Messages.RealmList),
                                                         global::PhotonServerCommon.Messages.RealmList.Parser,
                                                         new[] {"RealmServer"}, null, null, null),
                                                     new pbr::GeneratedCodeInfo(
                                                         typeof (global::PhotonServerCommon.Messages.RealmServer),
                                                         global::PhotonServerCommon.Messages.RealmServer.Parser,
                                                         new[]
                                                         {
                                                             "RealmName", "RealmServerId", "CurrentPopulation",
                                                             "MaximumPopulation", "Queue"
                                                         }, null, null, null)
                                                 }));
        }

        #endregion
    }

    #region Messages

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    public sealed partial class RealmList : pb::IMessage<RealmList>
    {
        /// <summary>Field number for the "RealmServer" field.</summary>
        public const int RealmServerFieldNumber = 1;

        private static readonly pb::MessageParser<RealmList> _parser =
            new pb::MessageParser<RealmList>(() => new RealmList());

        private static readonly pb::FieldCodec<global::PhotonServerCommon.Messages.RealmServer>
            _repeated_realmServer_codec
                = pb::FieldCodec.ForMessage(10, global::PhotonServerCommon.Messages.RealmServer.Parser);

        public static pb::MessageParser<RealmList> Parser
        {
            get { return _parser; }
        }

        public static pbr::MessageDescriptor Descriptor
        {
            get { return global::PhotonServerCommon.Messages.RealmListMessageReflection.Descriptor.MessageTypes[0]; }
        }

        pbr::MessageDescriptor pb::IMessage.Descriptor
        {
            get { return Descriptor; }
        }

        public pbc::RepeatedField<global::PhotonServerCommon.Messages.RealmServer> RealmServer
        {
            get { return realmServer_; }
        }

        private readonly pbc::RepeatedField<global::PhotonServerCommon.Messages.RealmServer> realmServer_ =
            new pbc::RepeatedField<global::PhotonServerCommon.Messages.RealmServer>();

        public RealmList()
        {
            OnConstruction();
        }

        public RealmList(RealmList other) : this()
        {
            realmServer_ = other.realmServer_.Clone();
        }

        partial void OnConstruction();

        public RealmList Clone()
        {
            return new RealmList(this);
        }

        public override bool Equals(object other)
        {
            return Equals(other as RealmList);
        }

        public bool Equals(RealmList other)
        {
            if (ReferenceEquals(other, null))
            {
                return false;
            }
            if (ReferenceEquals(other, this))
            {
                return true;
            }
            if (!realmServer_.Equals(other.realmServer_)) return false;
            return true;
        }

        public override int GetHashCode()
        {
            int hash = 1;
            hash ^= realmServer_.GetHashCode();
            return hash;
        }

        public override string ToString()
        {
            return pb::JsonFormatter.ToDiagnosticString(this);
        }

        public void WriteTo(pb::CodedOutputStream output)
        {
            realmServer_.WriteTo(output, _repeated_realmServer_codec);
        }

        public int CalculateSize()
        {
            int size = 0;
            size += realmServer_.CalculateSize(_repeated_realmServer_codec);
            return size;
        }

        public void MergeFrom(RealmList other)
        {
            if (other == null)
            {
                return;
            }
            realmServer_.Add(other.realmServer_);
        }

        public void MergeFrom(pb::CodedInputStream input)
        {
            uint tag;
            while ((tag = input.ReadTag()) != 0)
            {
                switch (tag)
                {
                    default:
                        input.SkipLastField();
                        break;
                    case 10:
                    {
                        realmServer_.AddEntriesFrom(input, _repeated_realmServer_codec);
                        break;
                    }
                }
            }
        }
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    public sealed partial class RealmServer : pb::IMessage<RealmServer>
    {
        /// <summary>Field number for the "RealmName" field.</summary>
        public const int RealmNameFieldNumber = 1;

        /// <summary>Field number for the "RealmServerId" field.</summary>
        public const int RealmServerIdFieldNumber = 2;

        /// <summary>Field number for the "CurrentPopulation" field.</summary>
        public const int CurrentPopulationFieldNumber = 3;

        /// <summary>Field number for the "MaximumPopulation" field.</summary>
        public const int MaximumPopulationFieldNumber = 4;

        /// <summary>Field number for the "Queue" field.</summary>
        public const int QueueFieldNumber = 5;

        private static readonly pb::MessageParser<RealmServer> _parser =
            new pb::MessageParser<RealmServer>(() => new RealmServer());

        public static pb::MessageParser<RealmServer> Parser
        {
            get { return _parser; }
        }

        public static pbr::MessageDescriptor Descriptor
        {
            get { return global::PhotonServerCommon.Messages.RealmListMessageReflection.Descriptor.MessageTypes[1]; }
        }

        pbr::MessageDescriptor pb::IMessage.Descriptor
        {
            get { return Descriptor; }
        }

        public string RealmName
        {
            get { return realmName_; }
            set { realmName_ = pb::Preconditions.CheckNotNull(value, "value"); }
        }

        public string RealmServerId
        {
            get { return realmServerId_; }
            set { realmServerId_ = pb::Preconditions.CheckNotNull(value, "value"); }
        }

        public int CurrentPopulation
        {
            get { return currentPopulation_; }
            set { currentPopulation_ = value; }
        }

        public int MaximumPopulation
        {
            get { return maximumPopulation_; }
            set { maximumPopulation_ = value; }
        }

        public int Queue
        {
            get { return queue_; }
            set { queue_ = value; }
        }

        private string realmName_ = "";
        private string realmServerId_ = "";
        private int currentPopulation_;
        private int maximumPopulation_;
        private int queue_;

        public RealmServer()
        {
            OnConstruction();
        }

        public RealmServer(RealmServer other) : this()
        {
            realmName_ = other.realmName_;
            realmServerId_ = other.realmServerId_;
            currentPopulation_ = other.currentPopulation_;
            maximumPopulation_ = other.maximumPopulation_;
            queue_ = other.queue_;
        }

        partial void OnConstruction();

        public RealmServer Clone()
        {
            return new RealmServer(this);
        }

        public override bool Equals(object other)
        {
            return Equals(other as RealmServer);
        }

        public bool Equals(RealmServer other)
        {
            if (ReferenceEquals(other, null))
            {
                return false;
            }
            if (ReferenceEquals(other, this))
            {
                return true;
            }
            if (RealmName != other.RealmName) return false;
            if (RealmServerId != other.RealmServerId) return false;
            if (CurrentPopulation != other.CurrentPopulation) return false;
            if (MaximumPopulation != other.MaximumPopulation) return false;
            if (Queue != other.Queue) return false;
            return true;
        }

        public override int GetHashCode()
        {
            int hash = 1;
            if (RealmName.Length != 0) hash ^= RealmName.GetHashCode();
            if (RealmServerId.Length != 0) hash ^= RealmServerId.GetHashCode();
            if (CurrentPopulation != 0) hash ^= CurrentPopulation.GetHashCode();
            if (MaximumPopulation != 0) hash ^= MaximumPopulation.GetHashCode();
            if (Queue != 0) hash ^= Queue.GetHashCode();
            return hash;
        }

        public override string ToString()
        {
            return pb::JsonFormatter.ToDiagnosticString(this);
        }

        public void WriteTo(pb::CodedOutputStream output)
        {
            if (RealmName.Length != 0)
            {
                output.WriteRawTag(10);
                output.WriteString(RealmName);
            }
            if (RealmServerId.Length != 0)
            {
                output.WriteRawTag(18);
                output.WriteString(RealmServerId);
            }
            if (CurrentPopulation != 0)
            {
                output.WriteRawTag(24);
                output.WriteInt32(CurrentPopulation);
            }
            if (MaximumPopulation != 0)
            {
                output.WriteRawTag(32);
                output.WriteInt32(MaximumPopulation);
            }
            if (Queue != 0)
            {
                output.WriteRawTag(40);
                output.WriteInt32(Queue);
            }
        }

        public int CalculateSize()
        {
            int size = 0;
            if (RealmName.Length != 0)
            {
                size += 1 + pb::CodedOutputStream.ComputeStringSize(RealmName);
            }
            if (RealmServerId.Length != 0)
            {
                size += 1 + pb::CodedOutputStream.ComputeStringSize(RealmServerId);
            }
            if (CurrentPopulation != 0)
            {
                size += 1 + pb::CodedOutputStream.ComputeInt32Size(CurrentPopulation);
            }
            if (MaximumPopulation != 0)
            {
                size += 1 + pb::CodedOutputStream.ComputeInt32Size(MaximumPopulation);
            }
            if (Queue != 0)
            {
                size += 1 + pb::CodedOutputStream.ComputeInt32Size(Queue);
            }
            return size;
        }

        public void MergeFrom(RealmServer other)
        {
            if (other == null)
            {
                return;
            }
            if (other.RealmName.Length != 0)
            {
                RealmName = other.RealmName;
            }
            if (other.RealmServerId.Length != 0)
            {
                RealmServerId = other.RealmServerId;
            }
            if (other.CurrentPopulation != 0)
            {
                CurrentPopulation = other.CurrentPopulation;
            }
            if (other.MaximumPopulation != 0)
            {
                MaximumPopulation = other.MaximumPopulation;
            }
            if (other.Queue != 0)
            {
                Queue = other.Queue;
            }
        }

        public void MergeFrom(pb::CodedInputStream input)
        {
            uint tag;
            while ((tag = input.ReadTag()) != 0)
            {
                switch (tag)
                {
                    default:
                        input.SkipLastField();
                        break;
                    case 10:
                    {
                        RealmName = input.ReadString();
                        break;
                    }
                    case 18:
                    {
                        RealmServerId = input.ReadString();
                        break;
                    }
                    case 24:
                    {
                        CurrentPopulation = input.ReadInt32();
                        break;
                    }
                    case 32:
                    {
                        MaximumPopulation = input.ReadInt32();
                        break;
                    }
                    case 40:
                    {
                        Queue = input.ReadInt32();
                        break;
                    }
                }
            }
        }
    }

    #endregion
}

#endregion Designer generated code
